home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / exampleCode / inventor / DirectManipRevoSurf / RevoSurfEngine.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  2.6 KB  |  88 lines

  1. /*
  2.  * Copyright (C) 1994, Silicon Graphics, Inc.
  3.  * All Rights Reserved.
  4.  *
  5.  * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  6.  * the contents of this file may not be disclosed to third parties, copied or
  7.  * duplicated in any form, in whole or in part, without the prior written
  8.  * permission of Silicon Graphics, Inc.
  9.  *
  10.  * RESTRICTED RIGHTS LEGEND:
  11.  * Use, duplication or disclosure by the Government is subject to restrictions
  12.  * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  13.  * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  14.  * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  15.  * rights reserved under the Copyright Laws of the United States.
  16.  */
  17. //  -*- C++ -*-
  18.  
  19. /*
  20.  * Copyright (C) 1994   Silicon Graphics, Inc.
  21.  *
  22.  _______________________________________________________________________
  23.  ______________  S I L I C O N   G R A P H I C S   I N C .  ____________
  24.  |
  25.  |   $Revision: 1.0 $
  26.  |
  27.  |   Description:
  28.  |    This file contains the declaration of an engine 
  29.  |      that calculates a surface of revolution
  30.  |      linkages
  31.  |
  32.  |   Classes:
  33.  |    RevoSurfEngine
  34.  |
  35.  |   Author(s)        : Paul Isaacs
  36.  |
  37.  ______________  S I L I C O N   G R A P H I C S   I N C .  ____________
  38.  _______________________________________________________________________
  39.  */
  40.  
  41. #ifndef  __REVO_SURF_ENGINE_
  42. #define  __REVO_SURF_ENGINE_
  43.  
  44. #include <Inventor/engines/SoSubEngine.h>
  45. #include <Inventor/fields/SoMFLong.h>
  46. #include <Inventor/fields/SoMFVec3f.h>
  47. #include <Inventor/fields/SoSFFloat.h>
  48. #include <Inventor/fields/SoSFVec3f.h>
  49.  
  50. /////////////////////////////////////////////////////////////
  51. //  RevoSurfEngine
  52. //
  53. //
  54. /////////////////////////////////////////////////////////////
  55. class RevoSurfEngine : public SoEngine {
  56.     SO_ENGINE_HEADER(RevoSurfEngine);
  57.   public:
  58.  
  59.     RevoSurfEngine();
  60.  
  61.     // Inputs:
  62.     SoSFVec3f   axisPt1;       // 2 points define axis to revolve around.
  63.     SoSFVec3f   axisPt2;       
  64.     SoMFVec3f   profileCoords; // Coords that will rotate about the axis.
  65.     SoSFFloat   angle;         // Angle between points around circle.
  66.     
  67.     // Outputs:
  68.     // Grid of coordinates that comprise the surface
  69.     SoEngineOutput gridOfCoords;       // (SoMFVec3f) 
  70.  
  71.     // You can connect this output to the coordIndex of an SoIndexedFaceSet.
  72.     SoEngineOutput faceIndices;        // (SoMFLong) 
  73.  
  74.   SoINTERNAL public:
  75.     static void initClass();
  76.   private:
  77.     ~RevoSurfEngine();
  78.     virtual void evaluate();
  79.  
  80.     void loadFaceIndices( long numRows, long numCols );
  81.  
  82.     SoMFVec3f scratchVecField;
  83.  
  84.     long oldVertsPerCol, oldVertsPerRow;
  85. };
  86.  
  87. #endif  /* __REVO_SURF_ENGINE_ */
  88.